package com.swh.xbsc.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.swh.xbsc.entity.Article;
import com.swh.xbsc.entity.User;
import com.swh.xbsc.entity.UserFocus;
import com.swh.xbsc.mapper.UserFocusMapper;
import com.swh.xbsc.mapper.UserMapper;
import com.swh.xbsc.service.UserFocusService;
import com.swh.xbsc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @Author: swh
 * @Description:
 * @Date: 2020/11/17 20:45
 * @Version: 1.0
 */
@Service
@Transactional
public class UserFocusServicelmpl extends BaseServicelmpl<UserFocus,Integer> implements UserFocusService {

    @Autowired
    UserFocusMapper userFocusMapper;

    @Override
    public PageInfo<UserFocus> selectPage(int pageNum, int pageSize, Map<String, Object> map) {
        PageHelper.startPage(pageNum,pageSize);
        List<UserFocus> selectPage = userFocusMapper.selectPage(map);
        PageInfo<UserFocus> pageInfo = new PageInfo<>(selectPage);
        return pageInfo;
    }

    public int  doDelete(Integer id) {
        return userFocusMapper.doDelete(id);
    }
}
